var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var runSequence = require('run-sequence');

//压缩来自npm的js资源文件
gulp.task('lib', function () {
    gulp.src([
        'node_modules/angular/angular.js',
        'node_modules/bootstrap/dist/css/bootstrap.css',
        'node_modules/font-awesome/css/font-awesome.css'
    ]).pipe(gulp.dest('src/lib'));
});

// 静态服务器
gulp.task('browser-sync',function(){
    browserSync.init({
        server: {
            baseDir:"src"
        }
    });
});

gulp.task('default', function () {
    runSequence('lib',"browser-sync");
    gulp.watch("src/**", browserSync.reload);
});
